/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.Serializable;
import javax.annotation.Generated;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author edilson
 */
@Entity
@Table(name = "ConteudoDaEmenta")
public class ConteudoDaEmenta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;

    @JoinColumn(name="conteudo", referencedColumnName= "id")
    @ManyToOne
    private Conteudo conteudo;

    @JoinColumn(name="ementa", referencedColumnName= "id")
    @ManyToOne
    private Ementa ementa;

    public ConteudoDaEmenta() {
    }

    public ConteudoDaEmenta(Integer id) {
        this.id = id;
    }

    public ConteudoDaEmenta(Integer id, Conteudo conteudo, Ementa ementa) {
        this.id = id;
        this.conteudo = conteudo;
        this.ementa = ementa;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Conteudo getConteudo() {
        return conteudo;
    }

    public void setConteudo(Conteudo conteudo) {
        this.conteudo = conteudo;
    }

    public Ementa getEmenta() {
        return ementa;
    }

    public void setEmenta(Ementa ementa) {
        this.ementa = ementa;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConteudoDaEmenta)) {
            return false;
        }
        ConteudoDaEmenta other = (ConteudoDaEmenta) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.ConteudoDaEmenta[id=" + id + "]";
    }

}
